import { IsBoolean, IsInt, IsNotEmpty, IsOptional, IsString, MaxLength, Min } from "class-validator";

export default class CreateDto{
    @IsString()
    @MaxLength(30)
    @IsNotEmpty()
    name: string;
  
    @IsString()
    @MaxLength(10)
    @IsOptional()
    type: 'FOLD' | 'PAGE' | 'BUTTON';
  
    @IsString()
    @MaxLength(50)
    @IsOptional()
    path: string;
  
    @IsString()
    @MaxLength(50)
    @IsOptional()
    component: string;
  
    @IsString()
    @MaxLength(100)
    @IsOptional()
    permission: string;
  
    @IsString()
    @MaxLength(100)
    @IsOptional()
    api: string;
  
    @IsString()
    @MaxLength(10)
    @IsOptional()
    apiMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';
  
    @IsBoolean()
    @IsOptional()
    keepAlive: boolean;
  
    @IsBoolean()
    @IsOptional()
    display: boolean;
  
    @IsBoolean()
    enable: boolean;
  
    @Min(0)
    @IsInt()
    @IsOptional()
    sort: number;
  
    @Min(0)
    @IsInt()
    parentId: number;
}